import request from '@/utils/goods';

// 枚举地址
enum API_URL {
  // 获取sku列表的地址
    SKU_LIst='/admin/product/list/',
    // 商品上架
    SKU_ONSALE='/admin/product/onSale/',
    // 商品下架
    SKU_CANCELSALE='/admin/product/cancelSale/',
    // 商品详情的地址
    SKU_DETAIL='/admin/product/getSkuById/',



    // 删除sku的地址
    SKU_DELETE='/admin/product/deleteSku/'
}



// 获取sku列表的接口
export const rerSkuList = (page:number,pageSize:number)=>{
  return request.get(API_URL.SKU_LIst+`${page}/${pageSize}`)
}
// 商品上架的接口
export const reqSkuOnsale = (skuId:number)=>{
  return request.get(API_URL.SKU_ONSALE+skuId)
}
// 商品下架的接口
export const reqSkuCancelSale = (skuId:number)=>{
  return request.get(API_URL.SKU_CANCELSALE+skuId)
}
// 获取商品详情的接口
export const reqSkuDetail = (skuId:number)=>{
  return request.get(API_URL.SKU_DETAIL+skuId)
}


// 删除sku的接口
export const reqSkuDelete = (skuId:number)=>{
  return request.delete(API_URL.SKU_DELETE+skuId)
}